/*
Global variables for the AC motor controller
It's naughty to store variables in here so move them elsewhere if it at all makes sense.
*/

volatile int overCurrentHasOccurred = 0;	// Has an overcurrent event occurred on at least 1 of the 3 phases? 

volatile unsigned max_current_ref = 0;			// max_current_ref in variable so controlled by temperature
volatile unsigned current_ref = 0;

volatile unsigned int fault_bits = 0;// = PRECHARGE_FAULT;

unsigned int PWM_BIAS = 0; //the middle point where power is zero
unsigned int MAX_PWM; //the maximum value we can set PWM to

volatile unsigned int hv_raw_input;
unsigned int volt_gain; //how many volts (in .1 increments) each ADC value represents
unsigned int current_gain; //how many amps (in .1 increments) each ADC value represents
unsigned int current_bias; //the zero point for amperage
